<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>BACKGROUND</title>
<%include file="_head.html"/>
</head>
<body>

<div class="navbar navbar-fixed-top">

<%include file="_header.html" />

</div>

<div class="container-fluid">

<div class="row-fluid">

<div class="span2">
<!--Sidebar content-->
    <%include file="_sidebar.html" />
</div>
<div class="span10">
    <div id="content">
        %if id:
        <%include file="_tabmenu.html" />
        %endif

        <h1>PANEO BACKGROUND 
        %if mode != 'view':
        <a href="/paneo/background/" class="btn" style="margin-left:30px;">一覧に戻る</a>
        %endif
        </h1>
        %if mode == 'view' :
        <%include file="_page_list.html" args="edit='background'"/>
        %endif:
        <!-- form -->
        %if id :
        <form class="form-horizontal"  enctype="multipart/form-data" method="POST">
        <fieldset>
        <legend>[ ${id} ] BACKGROUND 編集
        
        %if scfg.get('PAGEMAKE') == 'CMS':
        <a href="/${id}.html" target="_blank" class="icon-share-alt">
        <span class="label">
        ページ表示
        </span>
        </a>
        %else:
        <a href="/${id}.html" target="_blank" class="icon-share-alt">
        <span class="label">
        ページ表示
        </span>
        </a>
        %endif
        
        </legend>

            %for k,v in sorted( html_fields.items(), key=lambda x:x[1].get('idx')):
            <% ext = v.get('ext',{}) %>
            <% style = ext.get('style',{}) %>
            <div class="control-group">
            <label class="control-label" for="${k}">
            ${v.get('title')}
            <div>
            <img src="${ext.get('img_src')}">
            </div>
            %if v.get('id') != 'body':
            ${v.get('tag')}#${ext.get('bk_id')}
            %else:
            body
            %endif
            </label>

            <div class="controls">
            <span class="label help-block">BACKGROUND 画像 FILE UPLOAD</span> 
            <input type="file" id="${k}_file" name="${k}_file" size="20"><br>
            <input type="checkbox" id="${k}_file_del" name="${k}_file_del" value="True">
            <span class="help-inline">
            アップロードした画像を削除する場合はチェックしてください。 <br>
            FILE:/${PANEO_SITE_DIR}/img/<b>${k}</b>
            </span>
            </div>

            <div class="controls">
            <span class="label help-block">BACKGROUND 画像URL指定 </span>
            <input type="text" id="${k}_src" name="${k}_src" class="input-xlarge span6" value="${ext.get('src')}">
            <input type="checkbox" id="${k}_src_on" name="${k}_src_on" value="True" ${ 'checked' if ext.get('src_on') else ''}>
            <span class="help-inline">
            URL指定を優先する場合はチェックしてください。
            </span>
            <span class="label help-block">BACKGOURND CSS指定</span> 
            </div>

            <div class="controls">
            <span>SIZE<a href="http://www.htmq.com/css3/background-size.shtml" target="_blank" class="icon-info-sign"></a></span>
            <input type="text" id="${k}_size" name="${k}_size" style="width:80px;" value="${style.get('size')}">
            <span>REPEAT<a href="http://www.htmq.com/style/background-repeat.shtml" target="_blank" class="icon-info-sign"></a></span>
            <input type="text" id="${k}_repeat" name="${k}_repeat" style="width:80px;" value="${style.get('repeat')}">
            <span>POSITION<a href="http://www.htmq.com/style/background-position.shtml" target="_blank" class="icon-info-sign"></a></span>
            <input type="text" id="${k}_position" name="${k}_position" style="width:80px;" value="${style.get('position')}">
            </div>
            <div class="controls">
            <div>その他</div>
            <textarea id="${k}_etc" name="${k}_etc" rows="3" style="width:80%;">${style.get('etc')}</textarea>
            </div>

            </div>

            <hr>
            %endfor

            <div class="form-actions">
                <button class="btn btn-primary" type="submit">更新する</button>
                <button class="btn" type="reset" style="margin-left:20px;">Cancel</button>
            </div>
        </fieldset>
        </form>
        %endif
    </div><!--/div#content row span-->
</div>

</div><!--/row-->

</div><!--/container-fluid"-->

<hr>

<%include file="_footer.html" />

</div><!--/.fluid-container-->

</body>
</html>


